#ifndef __AFXTEMPLEX_INL__
#define __AFXTEMPLEX_INL__

template<class KEY1, class VALUE>
VALUE* GETResultKeyAddress(std::map<KEY1, VALUE > &mapResult, KEY1 key1, bool blnInsert/* = true*/)
{
  VALUE*pAdress = NULL;

  std::map<KEY1, VALUE >::iterator itkeyAddress = mapResult.find(key1);

  if (itkeyAddress == mapResult.end() && blnInsert)
  {
    VALUE keyAddress;
    mapResult[key1] = keyAddress;
  }

  itkeyAddress = mapResult.find(key1);
  if (itkeyAddress != mapResult.end())
  {
    pAdress = &mapResult[key1];
  }

  return pAdress;
}


template<class KEY1, class VALUE>
 VALUE* GETResultKeyAddressConst( std::map<KEY1, VALUE > &mapResult, KEY1 key1 )
{

   VALUE*pAdress = NULL;

  std::map<KEY1, VALUE >::iterator itkeyAddress = mapResult.find(key1);

  itkeyAddress = mapResult.find(key1);
  if (itkeyAddress != mapResult.end())
  {
    pAdress = &(itkeyAddress->second);
  }

  return pAdress;
}

#endif